const fs = require('fs')
const path = require('path')

// 拼接出绝对路径
fs.writeFile(path.join(__dirname,'demo.txt'), '文件写入测试', err => {
    if(err) {
        console.log(err)
        retrun
    }
    console.log('文件写入成功')
})